package nowcode;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;

public class StringChip {

    public static void main(String[] args) {
        InputStream is = System.in;
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            String inputStr = br.readLine();
            myFunction(inputStr);
            myFunction2(inputStr);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void myFunction(String string) {
        List<String> stringSet = new ArrayList<>();
        char c = 0;
        int length = 1;
        for (int i = 0; i < string.length(); i++) {
            char y = string.charAt(i);
            if (i == 0) {
                c = y;
                continue;
            }
            if (y == c) {
                length++;
            } else if (y != c && length > 0) {
                stringSet.add(new String(new char[length]).replace("\0", String.valueOf(c)));
                c = y;
                length = 1;
            }
        }
        stringSet.add(new String(new char[length]).replace("\0", String.valueOf(c)));
        System.out.println(new BigDecimal(stringSet.stream().mapToInt((s) -> s.length()).average().getAsDouble()).setScale(2, RoundingMode.HALF_UP));
    }

    public static void myFunction2(String string) {
        char c = 0;
        int type = 1;

        for (int i = 0; i < string.length(); i++) {
            char y = string.charAt(i);
            if (i == 0) {
                c = y;
                continue;
            }
            if (c != y) {
                type++;
                c = y;
            }
        }
        System.out.println(new BigDecimal((float) string.length() / type).setScale(2, RoundingMode.HALF_UP));
    }
}




